package com.proba.annotations.pojo;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.samples.mvc.basic.model.Identifiable;

@Entity
@Table(name = "SLUZBA", schema = "MAVROVO")
@SuppressWarnings("serial")
@javax.persistence.SequenceGenerator(
    name="sluzba_seq",
    sequenceName="sluzba_seq", allocationSize=1
)
public class Sluzba implements Identifiable {

	/**
	 * Attribute id.
	 */
	private Long id;
	
	/**
	 * Attribute sluzba.
	 */
	private String investitor;
	
	
	/**
	 * @return id
	 */
	@Basic
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="sluzba_seq")
		public Long getId() {
		return id;
	}

	/**
	 * @param id new value for id 
	 */
	public void setId(Long id) {
		this.id = id;
	}
	
	/**
	 * @return sluzba
	 */
	@Basic
	@Column(name = "SLUZBA", length = 40)
		public String getInvestitor() {
		return investitor;
	}

	/**
	 * @param sluzba new value for sluzba 
	 */
	public void setInvestitor(String sluzba) {
		this.investitor = sluzba;
	}
	
	public String toString() {
		return this.getInvestitor();
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Sluzba other = (Sluzba) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}